import React, { useState } from "react";
import {
  MenuFoldOutlined,
  MenuUnfoldOutlined,
  MailOutlined,
  AppstoreOutlined,
  SettingOutlined,
} from "@ant-design/icons";
import { Button, Layout, Menu, theme } from "antd";
import Guoxingyun from '../../assets/guo.png'
import { Outlet,useNavigate } from "react-router-dom";
const { Header, Sider, Content } = Layout;
const Management = () => {
  const nav = useNavigate();
  const [collapsed, setCollapsed] = useState(false);
  const {
    token: { colorBgContainer, borderRadiusLG },
  } = theme.useToken();
const onClick = (e) => {
    nav(e.key);
  };
  return (
    <Layout>
      <Sider trigger={null} collapsible style={{background:'#fff'}} collapsed={collapsed}>
        <img
          src={Guoxingyun}
          alt=""
          style={{ color: "#fff", width: "140px", height: "50px",marginLeft:'20px' }}
        />
        <Menu
          // theme="dark"
          mode="inline"
          defaultSelectedKeys={["/management/materialDownload"]}
          onClick={onClick}
          items={[
            {
              key: "/management/account",
              label: "首页",
              icon: <MailOutlined />,
            },
            {
              key: "/management/materialDownload",
              label: "果币充值",
              icon: <AppstoreOutlined />,
            },
            {
              key: "/management/authorization",
              label: "财务",
              icon: <AppstoreOutlined />,
            },
            {
              label: "订单",
              icon: <SettingOutlined />,
            },
            {
              label: "商品",
              icon: <SettingOutlined />,
            },
            {
              label: "店铺",
              icon: <SettingOutlined />,
            },
            {
              label: "提现",
              icon: <SettingOutlined />,
            },
            {
              label: "优惠券",
              icon: <SettingOutlined />,
            },
            {
              
              label: "运费统计",
              icon: <SettingOutlined />,
            },
            
          ]}
        />
      </Sider>
      <Layout>
        <Header
          style={{
            padding: 0,
            background: colorBgContainer,
          }}
        >
          <Button
            type="text"
            icon={collapsed ? <MenuUnfoldOutlined /> : <MenuFoldOutlined />}
            onClick={() => setCollapsed(!collapsed)}
            style={{
              fontSize: "16px",
              width: 64,
              height: 64,
            }}
          />
        </Header>
        <Content
          style={{
            margin: "24px 16px",
            padding: 24,
            minHeight: 280,
            background: colorBgContainer,
            borderRadius: borderRadiusLG,
          }}
        >
          <Outlet></Outlet>
        </Content>
      </Layout>
    </Layout>
  );
};
export default Management;
